package s63.kong.shop.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import s63.kong.shop.pojo.AjaxResult;
import s63.kong.shop.service.DeptService;

@RestController
@RequestMapping("dept")
public class DeptController {
    @Autowired
    private DeptService deptService;

    @GetMapping
    @PreAuthorize("hasAuthority('dept:list')")
    public AjaxResult list(){
        return AjaxResult.ok(deptService.selectAll());
    }
}
